


/* [start]	register */

	int currentYear = new registnet.dao.SystemPropertiesPeer().getSystemProperties().getAcademicYear();
	int nextSemester = new registnet.dao.SystemPropertiesPeer().getSystemProperties().getSemester() + 1;
	if(nextSemester>3) nextSemester=1;
	if(nextSemester==3) currentYear++;

	void register(){
		
		boolean isFinished = new registnet.dao.SlotPeer().hasData();
		if(isFinished){
			int isConfirmed = Messagebox.show("Restart Enlistment process?", "Question", Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
			if (isConfirmed == Messagebox.NO) return;
		}else{
			boolean isSatisfied = new registnet.dao.StudentStandingPeer().hasData(currentSemester,currentYear);
			 	isSatisfied = isSatisfied && (new registnet.dao.StudentClassificationPeer().hasData(currentSemester,currentYear));
				if(!isSatisfied){
					alert("Pre-Enlistment process is not yet finished.");
					return;
				}
		
			int isConfirmed = Messagebox.show("Proceed to the Enlistment process?", "Question", Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
			if (isConfirmed == Messagebox.NO) return;
		}
		
		desktop.enableServerPush(true);
		
		registnet.enlistment.Enlistor enlistor = new registnet.enlistment.Enlistor(desktop);
		enlistor.start();
		//new registnet.enlistment.SummaryGenerator().doGenerateSummary();
		
	}
	
/* [end] */